home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / Compute`s Amiga resource 1.adf / Source / 8ColorWbench / Colorbench.c < prev    next >
C/C++ Source or Header  |  1989-02-08  |  1KB  |  48 lines

  1. /*************************************************************************
  2.  *
  3.  *        Colorbench.c
  4.  *
  5.  *        Double the number of colors available on the Workbench screen by
  6.  *    adding another bitplane.
  7.  *
  8.  *************************************************************************/
  9.  
  10. #include <intuition/intuition.h>
  11.  
  12. struct Screen *Scr;
  13. struct BitMap *bm;
  14. struct IntuitionBase *IntuitionBase;
  15. struct GfxBase *GfxBase;
  16.  
  17. #define    WIDTH        Scr->Width
  18. #define    HEIGHT    Scr->Height
  19. #define    DEPTH        bm->Depth
  20.  
  21. void main()
  22. {
  23.     if((IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 32)) == NULL)
  24.         exit(100);
  25.  
  26.     if((GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", 32)) == NULL)
  27.       exit(200);
  28.  
  29.     Scr = (struct Screen *)OpenWorkBench();
  30.    if(Scr == NULL)
  31.        exit(300);
  32.  
  33.     bm = Scr->RastPort.BitMap;
  34.  
  35.     if(DEPTH == 2)
  36.     {
  37.         bm->Planes[2] = (PLANEPTR)AllocRaster(WIDTH, HEIGHT);
  38.         BltClear(bm->Planes[2], WIDTH / 8 * HEIGHT, 0);
  39.         DEPTH = 3;
  40.         RemakeDisplay();
  41.     }
  42.  
  43.     CloseLibrary(GfxBase);
  44.     CloseLibrary(IntuitionBase);
  45. }
  46.  
  47. /*   end of Colorbench.c   */
  48.